<template>
  <h1>双向绑定指令</h1>
  <input type="text" value="info">
  <input  type="text" :value="info"><br>
<!--  {{info}}-->
  用户名:<input type="text" placeholder="请输入用户名" v-model="user.username" >
  密码:<input type="text" placeholder="请输入密码" v-model="user.password" >
  性别:
  <input type="radio" name="gender" value="1" v-model="user.gender">男
  <input type="radio" name="gender" value="0" v-model="user.gender">女
  <br>
  <button @click="reg">点你提交</button>
</template>
<script setup>
import {ref} from "vue";

const info = ref('今天星期三')
// 定义对象用来保存用户注册的信息
const user = ref({
  username:'',
  password:'',
  gender:''
});
const reg=()=>{
  console.log('即将注册...');
  console.log(user.value);
}
</script>


<style scoped>

</style>